package cn.darkhorse.device.service.impl;

import cn.darkhorse.device.mapper.HardwareMapper;
import cn.darkhorse.device.pojo.MesDeviceNameMapping;
import cn.darkhorse.device.service.HardwareService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 设备名称对应表 服务实现类
 * </p>
 *
 * @author yuanjun
 * @since 2023-04-10
 */
@Service
public class HardwareServiceImpl extends ServiceImpl<HardwareMapper, MesDeviceNameMapping> implements HardwareService {

    @Resource
    private HardwareMapper hardwareMapper;

    @Override
    public List<MesDeviceNameMapping> getList(String deviceId) {
        LambdaQueryWrapper<MesDeviceNameMapping> queryWrapper = new LambdaQueryWrapper<MesDeviceNameMapping>();
        if (StringUtils.isNotBlank(deviceId)) {
            queryWrapper.like(MesDeviceNameMapping::getDataDeviceId,deviceId);
        }
        return hardwareMapper.selectList(queryWrapper);
    }
}
